$(function(){
    $.ajax({
        url: 'OrderServlet',
        type: 'GET',
        contentType:"application/json" ,
        cache: false,
        success: function(train){
            var msg = "train=" + train.trainno ;
            document.getElementById("buy").innerHTML= msg;
        }
    });
});